package com.tich.api.client;

import com.tich.api.domain.dto.BalanceDeductDTO;
import com.tich.api.domain.vo.UserSimpleVO;
import com.tich.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("user-service")
public interface UserClient {

    /**
     * 扣减用户余额
     * @param balanceDeductDTO
     * @return
     * */
    @PostMapping("/client/balance/deduct")
    public Result<Boolean> balanceDeduct(@RequestBody BalanceDeductDTO balanceDeductDTO);


    // 新增批量查询接口
    @GetMapping("/users/users")
    List<UserSimpleVO> getByIds(@RequestParam("userIds") List<Long> userIds);
}
